﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.Domain.Models;

namespace JXT.PrimaryKey.Batman.Domain.Quotation.Models
{
    public class TaskExecutedStatus : ValueObjectBase<TaskExecutedStatus>
    {
        public int Total { get; set; }

        public int Finished { get; set; }

        public int Skip { get; set; }

        public double FinishRate
        {
            get
            {
                if (Total <= 0)
                    return 0;
                return (double)Finished / (double)Total * 100;
            }
        }

        public override bool Equals(TaskExecutedStatus other)
        {
            if (other == null)
                return false;
            return other.Total == Total && other.Finished == Finished;
        }
    }
}
